package com.kate.cloud.shiro.converter;



import com.kate.cloud.shiro.dto.OrderDTO;
import com.kate.cloud.shiro.dto.UserDTO;
import com.kate.cloud.shiro.from.UserFrom;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

/**
 * Created by 李金照 on 2017/12/13.
 *
 * @author 金照
 */
@Component
@Slf4j
public class UserFrom2UserDTOConverter {
    public static UserDTO convert(UserFrom userFrom) {
        UserDTO userDTO = new UserDTO();
        userDTO.setId(userFrom.getId());
        BeanUtils.copyProperties(userFrom,userDTO);
        return userDTO;
    }
}
